package erz.printing.police;

import android.content.Intent;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class ZhianActivity extends BaseActivity implements View.OnClickListener {

    private View zhaoyinEntry;
    private View yangquanEntry;
    private View changsuoEntry;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_zhian);

        ActionBar actionBar = getSupportActionBar();
        actionBar.setDisplayHomeAsUpEnabled(true);

        initView();
    }

    @Override
    public boolean onSupportNavigateUp() {
        finish();
        return true;
    }

    private void initView() {
        zhaoyinEntry = findViewById(R.id.zhaoyin_entry);
        yangquanEntry = findViewById(R.id.yangquan_entry);
        changsuoEntry = findViewById(R.id.changsuojiancha_entry);

        zhaoyinEntry.setOnClickListener(this);
        yangquanEntry.setOnClickListener(this);
        changsuoEntry.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.zhaoyin_entry) {
            Intent intent = new Intent(this, PrintPhotoActivity.class);
            Bundle bundle = new Bundle();
            bundle.putString("checkTitle", "噪音违反法规");
            bundle.putString("docTemplateNotice", "责令XX通知书.html");
            bundle.putString("docTemplatePunishment", "当场处罚决定书.html");
            bundle.putString("noticeName", "责令改正");
            bundle.putString("punishmentName", "当场处罚");
            bundle.putString("title", "噪音整治");
            bundle.putBoolean("printTitle", true);
            intent.putExtras(bundle);
            startActivity(intent);
        } else if (v.getId() == R.id.yangquan_entry) {
            Intent intent = new Intent(this, PrintPhotoActivity.class);
            Bundle bundle = new Bundle();
            bundle.putString("checkTitle", "养犬违反法规");
            bundle.putString("docTemplateNotice", "依法养犬告知单.html");
            bundle.putString("docTemplatePunishment", "当场处罚决定书.html");
            bundle.putString("noticeName", "依法养犬告知书");
            bundle.putString("punishmentName", "当场处罚");
            bundle.putString("title", "养犬管理");
            bundle.putBoolean("printTitle", true);
            intent.putExtras(bundle);
            startActivity(intent);
        } else if (v.getId() == R.id.changsuojiancha_entry) {
            Intent intent = new Intent(this, PrintPhotoActivity.class);
            Bundle bundle = new Bundle();
            bundle.putString("checkTitle", "治安检查发现违反法规");
            bundle.putString("docTemplateNotice", "责令XX通知书.html");
            bundle.putString("docTemplatePunishment", "当场处罚决定书.html");
            bundle.putString("noticeName", "责令改正");
            bundle.putString("punishmentName", "当场处罚");
            bundle.putString("title", "场所检查");
            bundle.putBoolean("printTitle", true);
            intent.putExtras(bundle);
            startActivity(intent);
        }
    }
}
